package com.oig.sys.security.config;


import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@Slf4j
@Data
@ConfigurationProperties(prefix = "security.oauth2.ignore")
public class PermitUrlProperties implements InitializingBean {

    private List<String> urls = new ArrayList<>();


    @Override
    public void afterPropertiesSet() {
        log.info("ignore urls:{}", urls);
        urls.addAll(Stream.of("/druid/**","/v3/api-docs/**","/actuator/**","/error","/favicon.ico").collect(Collectors.toList()));
        log.info("add default ignore urls:{}", urls);
    }

}
